﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Input;
using System.Text.RegularExpressions;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.IO;
using System.Windows.Documents;

namespace CommomFunctions
{
    internal partial class Sobre_DialogBox : Window
    {
        
        Grid grid = new Grid();
        
        TextBlock txtNomesEemails = new TextBlock();
        Button btnOk = new Button();
        Image logoInf = new Image();
        Image logoUFRGS = new Image();

        internal Sobre_DialogBox()
        {
            
            this.Title = "Sobre";
            this.Height = 305;
            this.Width = 543;
            this.ResizeMode = ResizeMode.NoResize;
            this.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            this.Background = Brushes.Black;

            this.AddChild(grid);

            adicionaAoGrid();

            inicializaComponentes();

        }

     
        private void adicionaAoGrid()
        {
            grid.Children.Add(txtNomesEemails);
            
            grid.Children.Add(logoInf);
            
            grid.Children.Add(logoUFRGS);
        }

        private void inicializaBotao()
        {
            btnOk.Width = 65;
            btnOk.Height = 25;
            btnOk.Margin = new Thickness(0,0,125.377,34.04);
            btnOk.Click += okButton_Click;
            btnOk.HorizontalAlignment = HorizontalAlignment.Right;
            btnOk.VerticalAlignment = VerticalAlignment.Bottom;
            btnOk.Content = "OK";
        }

        private void inicializaImagens()
        {
            logoInf.Source = Imagens.loadBitmap(CommomFunctions.Properties.CommomResources.LogoInfBlack);
            logoInf.Margin = new Thickness(174, 0, 0, 19.481);
            logoInf.Stretch = Stretch.Uniform;
            logoInf.Height = 53.52;
            logoInf.Width = 86.56;
            logoInf.HorizontalAlignment = HorizontalAlignment.Left;
            logoInf.VerticalAlignment = VerticalAlignment.Bottom;

            logoUFRGS.Source = Imagens.loadBitmap(CommomFunctions.Properties.CommomResources.LogoUFRGSBlack);
            logoUFRGS.Margin = new Thickness(280.173, 0, 176.04, 21.481);
            logoUFRGS.Stretch = Stretch.Uniform;
            logoUFRGS.Height = 54.397;
            logoUFRGS.HorizontalAlignment = HorizontalAlignment.Left;
            logoUFRGS.VerticalAlignment = VerticalAlignment.Bottom;
        }

        private void inicializaTexto()
        {
            txtNomesEemails.Margin = new Thickness(0);
            txtNomesEemails.Foreground = Brushes.ForestGreen;
            txtNomesEemails.FontSize = 16;
            txtNomesEemails.FontWeight = FontWeights.Bold;
            txtNomesEemails.FontFamily = new FontFamily("Malgun Gothic");
            txtNomesEemails.Inlines.Add(new Run("\n"));
            txtNomesEemails.Inlines.Add(new Run("\n"));
            txtNomesEemails.Inlines.Add(new Run("  Desenvolvido por:\n"));
            txtNomesEemails.Inlines.Add(new Run("\n"));
            txtNomesEemails.Inlines.Add(new Run("\tBárbara Bellaver Gonçalves - bbgoncalves@inf.ufrgs.br\n"));
            txtNomesEemails.Inlines.Add(new Run("\tManuel Menezes de Oliveira Neto - oliveira@inf.ufrgs.br\n"));
            txtNomesEemails.Inlines.Add(new Run("\n"));
            txtNomesEemails.Inlines.Add(new Run("\t\tInstituto de Informática - UFRGS"));
        }

        private void inicializaComponentes()
        {
            inicializaImagens();
            inicializaTexto();
        }


        void okButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;

        }
    }
}
